package io.renren.common.enums;

public enum Teaching {
    one {
        public Integer getValue() {
            return 1;
        }

        public String getName() {
            return "不限";
        }

    },
    two {

        public Integer getValue() {
            return 2;
        }

        public String getName() {
            return "经典教材";
        }

    },
    three {

        public Integer getValue() {
            return 3;
        }

        public String getName() {
            return "考级教材";
        }

    };

    // 声明抽象方法
    public abstract Integer getValue();

    public abstract String getName();
    /**
     * 获取
     * @param type
     * @return
     */
    public static String getNameByValue(Integer type) {
        String name = "";
        if(type != null) {
            for (Teaching c : Teaching.values()) {
                if (c.getValue().intValue() == type.intValue()) {
                    name = c.getName();
                    break;
                }
            }
        }
        return name;

    }
}
